<?php

namespace IDock\Insurance\AICS\Request;

use Exception;
use IDock\Insurance\AICS\Request\AllAICSRequest;
use IDock\Insurance\AICS\Response\RenewalInquiryResponse;
use IDock\Visitor\RenewalInquiryVisitor;

class RenewalInquiryRequest extends AllAICSRequest
{
    public $code = 'newQueryRenewalInfoService';

    public $envelopeName = 'new:queryRenewalInfoService';

    protected $response = RenewalInquiryResponse::class;

    protected $urlTip = '续保查询';

    /*** @var  RenewalInquiryVisitor $visitor */
    protected $visitor;

    /**
     * @return array
     * @throws Exception
     */
    public function generate(): array
    {
        $param = [
            'condition' => [
                'queryType' => 2,
                'carMark' => $this->visitor->licenseNo,
                'engineNo' => $this->visitor->engineNo,
                'rackNo' => $this->visitor->vin,
                'policyNo' => '',
                'insuredName' => '',
                'ownerName' => '',
            ]
        ];
        return $param;
    }
}
